package com.zyq.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.zyq.service.AlbumServiceImpl;
import com.zyq.web.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags="04.相册管理")
@RestController
@RequestMapping("/albums")
public class AlbumController {

    @Autowired
    AlbumServiceImpl albumService;

    @ApiOperation("删除相册")
    @ApiOperationSupport(order=900)
    @ApiImplicitParam(name="id", value="相册id", required = true,paramType="long")
    @GetMapping("/{id:[0-9]+}/delete")
    public JsonResult<Void> delete(@PathVariable("id") Long id){
        log.debug("AlbumController--->delete():::开始删除id为{}的相册",id);
        albumService.delete(id);
        return  JsonResult.ok();
    }

}
